#include<iostream>
using namespace std;
long long arr[60];
int main()
{
	arr[1] = 3;
	arr[2] = 8;
	for (int i = 3; i < 50; i++) {
		arr[i] = 2 * (arr[i - 1] + arr[i - 2]);
	}
	int n;
	while (cin >> n) {
		cout << arr[n] << endl;
	}
	return 0;
}